package com.tedu.cotroller;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author CCFu
 * @version 1.0
 * @date 2021/12/15 10:56
 */
//2.Servlet程序想要被浏览器访问，必须规定好浏览器的访问方式
@WebServlet("/Hservlet")
//1.Servlet程序的实现标准，就有三种方式：implements Servlet，或继承extends GenericServlet 或extends HttpServlet
public class Hservlet extends HttpServlet {
    //3.doPost()用来处理那些 post的请求（method=post）
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("doPost。。。");
    }

    //4.doGet()用来处理那些 get的请求
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("doGet。。。");

    }
}
